/**
 * 食品管理
 */
import type { ResponseInterface } from 'src/common/interface/response';

/**
 * started 代表喜欢
 * ordinary 代表一般
 * disgusting 代表讨厌
 */
export type IsLoveTypes = 'started' | 'ordinary' | 'disgusting';

/**
 * vegetable: 蔬菜🥬
 * fruit: 水果
 * milkyTea: 奶茶
 * meat: 肉类
 * sweetmeat: 甜品
 * rest: 其他
 */
export type FoodType =
  | 'vegetable'
  | 'fruit'
  | 'milkyTea'
  | 'meat'
  | 'sweetmeat'
  | 'rest';

interface FoodInterface {
  id: number;
  name: string;
  // 是否喜欢
  loveType: IsLoveTypes;
  // 食品类型
  foodType: FoodType;
  description: string;
  createdAt: string;
  updatedAt: string;
}

// 插入数据库的数据
export type FoodDataInterface = Omit<FoodInterface, 'id'>;

// 查询接口
export type QueryParam = { keyword: string };
export type QueryResponse = ResponseInterface<FoodInterface[]>;

// 新增接口
export type AddParam = Omit<FoodInterface, 'id' | 'createdAt' | 'updatedAt'>;
export type AddResponse = ResponseInterface<object>;

// 更新接口
export type UpdateParam = FoodInterface;
export type UpdateResponse = ResponseInterface<object>;

// 删除接口
export type DeleteParam = Pick<FoodInterface, 'id'>;
export type DeleteResponse = ResponseInterface<object>;
